    <link href="<{COMMENT_CSS}>" rel="stylesheet">
    <h3 class="review_title">评论区</h3>
    <div class="review_list" id="msg_content">
	<div class="title">用户评价</div>
    <div class="review_ping">
        <div class="com_info clearfix"><span id="recommen_user">XDA网友</span>&nbsp;评论<b></b></div>
            <div class="com_con">
                <textarea class="com_mian" name="content" id="content"></textarea>
            </div>
            <div class="post">
                <span id="answer"><img src="<{COMMENT_RAND}>" /><input type="text" name="auth" id="auth" /></span>
                <input id="sub_msg" type="button" value="发 表" class="btn_post"/>
            </div>
            <div class="review_list_main clearfix">
                <div class="txtcon_b">
                    <span class ="facessss" id="show_msg_content"></span>
                </div>
            </div>
    </div>
</div>
    <script>
		var args = [];
		args['url'] = "<{COMMENT_PAGE}>";
		args['cookiename'] = "<{COMMENT_COOKIE}>";
		comment_run(args);
		
        function has_chinese(s){ 
            var patrn=/[\u4E00-\u9FA5]|[\uFE30-\uFFA0]/gi; 
            if(!patrn.exec(s)) return false; 
            else return true; 
        }
		
        function is_legal(c) {
            if(c.indexOf('www.')!==-1 || c.indexOf('url=http://')!==-1 || c.indexOf('http://')!==-1 ||c.indexOf('.com')!==-1) {
                return false;
            }else{
                return true;
            }
        }
    
        function getCookie(name) {
            var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
            if(arr != null) return unescape(arr[2]); return null;
        }

        function show_list(args, pag) {
            $.getJSON(              
                args['url'],
                {'pag':pag},
                function(data){
                    if(data && data.tol!='0'){
                        var list=data.list;                          
                        var comment = '';
                        var name = 'XDA网友';
                        $.each(list,function(i,n) {
                            if(n['username']!='undefined' || n['username']=='') {
                                name = n['username'];
                            }
                            comment += '<div class="newshow_left_msgfrm_btmline clearfix">';
                            comment += '<div class="newshow_left_msgfrm_left">';
                            comment += '<b color="#006699"><strong>'+name+'</strong></b> 于 '+n['ctime']+' 说:</div>';
                            comment += '<div id="user_box_'+n.id+'" class="newshow_left_msgfrm_right">'+n.content+'</div></div>';
                        });
                        $("#show_msg_content").html(comment);  
                        $("#pageNav").html(data.pager);
                        $("#total_msg").text(data.tol||0);
                        //$('div.com_info span.f_l b').html('(共'+data.tol+'条评论)');
                    }
                }
            );
        }
		
        function check_answer(answer, right, url) {
            if($.trim(answer)==''){
                alert('请输入验证码');
                fresh_rand(url);
                return false;
            }
            
            if(isNaN(answer)) {
                alert('验证码为数字');
                fresh_rand(url);
                clear_answer();
                return false;
            }
        
            if(answer!=void(0)){
                if(right!=answer){
                    alert('验证码有误');
                    fresh_rand(url);
                    clear_answer();
                    return false;
                }
            }else return true;
        }

        function check_content(c, url) {
            if($.trim(c)==''){		
                alert('评论不能为空');
                fresh_rand(url);
                return false;
            }
            c=c.replace(/<\S[^>]*>/g,'');
            if(!is_legal(c)) {
                alert('亲,你填入的信息包括URL字符');
                fresh_rand(url);
                return false;
            }			
            if(c.length>100) {
                alert("亲,留言内容必须在100字以内,请修改长度");
                fresh_rand(url);
                return false;
            }
        }

        function clear_answer() {
            $('span#answer input#auth').attr('value', '');
        }

        function fresh_rand(url) {
            var obj = $('div.review_ping div.post span#answer img');
            var href=obj.attr("src");
            $(obj[0]).attr("src",href+"?time="+new Date().getTime());
        }

        function post_comment(c, answer, args) {
            if(false==check_content(c, args['url'])) return false;
            var right = getCookie(args['cookiename']);
            if(false==check_answer(answer, right, args['url'])) return false;

            var username = 'XDA网友';
            var uid = 0;
            var status=1;
            $.getJSON("http://login.xda.cn/PPL/dz_login/login_info.php?callback=?",
            function(data){
                if(data && data.username) {
                    status=0;
                    username=data.username;
                    uid=data.uid;
                    var date = new Date();			
                    var cont = '<div style="background:#DFFFDF;" class="newshow_left_msgfrm_btmline clearfix">'+
                        '<div class="newshow_left_msgfrm_left">'+
                        '<b color="#006699"><strong>'+data.username+'</strong></b>'+
                        ' 于 '+date.getFullYear()+'年'+date.getDate()+'月'+date.getHours()+':'+date.getMinutes()+':'+date.getSeconds()+' 说：'+
                        '</div> <div class="newshow_left_msgfrm_right">'+c+' </div>';

                    var reply_num = $('div.txtcon_b span#show_msg_content div.newshow_left_msgfrm_btmline').length;
                    if(reply_num>=5) $("div.txtcon_b span#show_msg_content div.newshow_left_msgfrm_btmline:last").fadeOut(); //评论数大于5个 把最后一个隐藏掉

                    if(reply_num==0 ) {
                        $("div.txtcon_b span#show_msg_content").append(cont);
                    }else {
                        $("div.txtcon_b span#show_msg_content div.newshow_left_msgfrm_btmline:first").before(cont);
                    }
                }
                 $.post(args['url'], {},function(data){
                    },'json');
                 if(status!=0){
                    alert('评论已提交,需要后台审核');
                 }else{
                      show_list(args, pag);
                 }
                $('div.review_ping div.com_con textarea').attr('value', '');//清空内容
                clear_answer();
                fresh_rand(args['url']);//刷新验证码
            }); 

        }

        function loadScript(url,callback) {
            var script=document.createElement("script");
            script.type="text/javascript";
            if(script.readyState){
                script.onreadystatechange=function(){
                    if(script.readyState=='loaded'||script.readyState=='complete'){
                        script.onreadystatechange=null;
                        callback();
                    }
                }
            }else{script.onload=function(){callback();}}
            script.src=url;
            document.getElementsByTagName("head")[0].appendChild(script);
        }

        function deal_comment(args) {
            //初始加载第一页
            show_list(args, 1);
    	
            //分页
            $("#pageNav a").live("click",function(){
                var pag = parseInt($(this).attr('rel'));
                show_list(args, pag);
            });
    	
            //提交评论
            $('input#sub_msg').click(function() {
                var c = $('textarea#content').val();
                var answer = $.trim($('input#auth').val());
                post_comment(c, answer, args);
            });
        }

        function comment_run(args) {
            if(typeof jQuery!='function') {
                loadScript(args['url']+'jquery.min.js',function(){
					deal_comment(args);
                });
            }else{
                $(function(){
					deal_comment(args);
                });
            }
        }

    </script>